// 8624023
// 朝﹄和
// 88/3/19
import java.io.*;

class home1 //java 穨
{
  public static void main(String args[])throws IOException
  {
    int a,i,j,temp,letter=0,word=0,sentence=0,longestword=0,longestsentence=0;// i,j:计计ㄠノ,temp:ヘ玡弄
    System.out.print("   舧ㄏノセ祘Α\n");          // 秆弧祘Αノ硚
    System.out.print("   セ祘Α盢穦眤块ゅ彻矪瞶\n");
    System.out.print("   ウ盢穦璸衡计,羆计,ダ羆计,–キА局Τ计\n");
    System.out.print("   –キА局Τダ计,程ダ计,程计ぇ计单戈\n");
    System.out.print("   叫块璶矪瞶ゅ彻,挡叫Ctrl+z\n");
    temp=System.in.read();j=0;  // 弄材,reset j
    while(temp!=-1) // ゅ彻挡玡ぃ穦铬硂loop
    {
      if ((temp==',')|(temp=='"')|(temp==' ')) // 弄,"  铬筁
        temp=System.in.read();
      else if ((temp=='!')|(temp=='.')|(temp=='?')) // 弄! . ? 计
        {
          while(((temp=System.in.read())=='!')|(temp=='?'));
          sentence++;
          if (j>longestsentence)// 砞﹚程计
          longestsentence=j;
          j=0;
        }
        else if (temp==13) // 传︽
           {
             temp=System.in.read();
             temp=System.in.read();
           }
           else
           {
             i=0;// のダ笲衡
             while ((temp!=' ')&(temp!=',')&(temp!='!')&(temp!='.')&(temp!=13)&(temp!=-1)&(temp!='"')&(temp!='?'))
             {
               i++;
               letter++; // ダ计
               temp=System.in.read(); // 弄
             }
             if (i>longestword)  // 砞﹚程
             longestword=i;
             word++;// 计
             j++;
           }
    }
      System.out.print("\n\n计="+sentence+"\n");    // 挡狦
      System.out.println("羆计="+word);
      System.out.println("ダ羆计="+letter);
      System.out.println("–キА局Τ计="+(float)word/sentence);
      System.out.println("–キА局Τダ计="+(float)letter/word);
      System.out.println("程ダ计="+longestword);
      System.out.println("程计ぇ计="+longestsentence);
      System.out.println("Please press 'Enter' to leave!!");
      a=System.in.read();
  }
}
